/*
import lzm.dao.StudentRepository;
import lzm.entity.Address;
import lzm.entity.Student;
import lzm.service.IStudentService;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.FileSystemXmlApplicationContext;
import org.testng.annotations.Test;

import java.util.List;

public class TestSpring {

    */
/**
     * 获取配置文件路径
     * @return
     *//*

    public String getXmlPath() {
        String basePath = System.getProperty("user.dir");
        String springPath = basePath + "/src/main/webapp/WEB-INF/applicationContext.xml";
        return springPath;
    }


    @Test
    public void testppppp() {
        Double d = null;
        double s = d;
        System.out.println(s);


    }



    @Test
    public void test() {
        ApplicationContext applicationContext = new FileSystemXmlApplicationContext(getXmlPath());

        Address address = applicationContext.getBean("address", Address.class);


    }


    @Test
    public void testDao() {
        ApplicationContext applicationContext = new FileSystemXmlApplicationContext(getXmlPath());
        StudentRepository studentRepository = applicationContext.getBean("studentRepository", StudentRepository.class);
        //通过ID获取对象
        Student student = studentRepository.findById(1L);
        System.out.println("student>>>" + student);

        List<Student> studentList = studentRepository.findAll();
        System.out.println("studentList>>>" + studentList);

    }


    @Test
    public void testUpdate() {
        ApplicationContext applicationContext = new FileSystemXmlApplicationContext(getXmlPath());
        IStudentService studentService = applicationContext.getBean("studentService", IStudentService.class);
        studentService.updateName("张三01", 1L);
    }

*/
/*
    @Test
    public void testProperties() {
        ApplicationContext applicationContext = new ClassPathXmlApplicationContext("bean.xml");
        DruidDataSource datSource = applicationContext.getBean("datSource", DruidDataSource.class);
        System.out.println(datSource.getUrl());
        System.out.println(datSource.getDriverClassName());
        System.out.println(datSource.getUsername());
        System.out.println(datSource.getPassword());
    }

    @Test
    public void testAutowire() {

        ApplicationContext applicationContext = new ClassPathXmlApplicationContext("bean.xml");
        IStudentService studentService = applicationContext.getBean("studentService", IStudentService.class);
        System.out.println(studentService);
        StudentServiceImpl service = (StudentServiceImpl)studentService;
        System.out.println(studentService);
        System.out.println(service.getValue());
        studentService.add();

    }

    *//*
*/
/**
     * 纯注解开发模式
     *//*
*/
/*
    @Test
    public void testConfigJava() {

        ApplicationContext applicationContext = new AnnotationConfigApplicationContext(WebXml.class);
        //ApplicationContext applicationContext = new ClassPathXmlApplicationContext("bean.xml");
        IStudentService studentService = applicationContext.getBean("studentService", IStudentService.class);
        System.out.println(studentService);
        StudentServiceImpl service = (StudentServiceImpl)studentService;
        System.out.println(studentService);
        System.out.println(service.getUrl());
        System.out.println(service.getValue());
        studentService.add();

        DruidDataSource druidDataSource = applicationContext.getBean("datSource", DruidDataSource.class);
        System.out.println(druidDataSource.getUsername());
        System.out.println(druidDataSource.getPassword());

    }

    @Test
    public void testAspectJ() {
        ApplicationContext applicationContext = new AnnotationConfigApplicationContext(WebXml.class);
        StudentDao studentDao = applicationContext.getBean("studentDao", StudentDao.class);
        IStudentService studentService = applicationContext.getBean("studentService", IStudentService.class);
        System.out.println(studentService);
        StudentServiceImpl service = (StudentServiceImpl)studentService;
        System.out.println(studentService);
        System.out.println(service.getUrl());
        System.out.println(service.getValue());
        studentService.add();

    }*//*




}
*/
